package co.yixiang.modules.rabbitMq.consumer;

import co.yixiang.modules.rabbitMq.constant.QueueConstants;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author yukong
 * @date 2018/8/22
 * @description rabbitmq消费者 @RabbitListener(queues = "simpleMsg") 监听名simpleMsg的队列
 */
//@Component
//@RabbitListener(queues = QueueConstants.TEST_QUEUE)
public class TestConsumer {
    /**
     * 消息消费
     * @RabbitHandler 代表此方法为接受到消息后的处理方法
     */
//    @RabbitHandler
    public void recieved(String msg) {
		System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
        System.out.println("[string] recieved message:" + msg);
		System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
	}

}